﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ChineseSchool.BLL;
using ChineseSchool.Models.Hethong;

namespace ChineseSchool.UserControl.ThuNghiem
{
    public partial class CamNhan : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
            lblCamNhan.Text = LoadTopCamnhanContent();
        }

        public string LoadTopCamnhanContent()
        {
            var strCamnhan = "";
            var lstTopCamnhan = new B_CamNhan().GetAlls(5);
            if (lstTopCamnhan != null && lstTopCamnhan.Count > 0)
            {
                strCamnhan += "<div class=\"thanhtieude\">";
                strCamnhan += "    <div class=\"vienletrai\"></div>";
                strCamnhan += "    <a href=\"#\">";
                strCamnhan += "        <h3 class=\"lichkhaigiang\"><span>Cảm nhận</span></h3>";
                strCamnhan += "    </a>";
                strCamnhan += "</div>";
                strCamnhan += "<div class=\"camnhanslide\">";
                foreach (var camNhan in lstTopCamnhan)
                {
                    strCamnhan += "<div>";
                    strCamnhan += "    <div class=\"loinhanxet\">";                    
                    strCamnhan += "        " + camNhan.tomTat +" <a href=\"#\"> ...Chi tiết</a>";
                    strCamnhan += "    </div>";
                    strCamnhan += "    <div class=\"arrowdown\"></div>";
                    strCamnhan += "    <div class=\"thumbnhanxet col-xs-12 col-sm-4 col-md-4 col-lg-4\">";
                    strCamnhan += "        <img src=\"" + camNhan.anhdaidien + "\" class=\"attachment-thumbnail wp-post-image\" alt=\"" + camNhan.hoten + "\">";
                    strCamnhan += "    </div>";
                    strCamnhan += "    <div class=\"thongtinnhanxet col-xs-12 col-sm-8 col-md-8 col-lg-8\">";
                    strCamnhan += "        <span>- Họ tên: "+camNhan.hoten+"</span>";
                    strCamnhan += "        <span>- Email: " + camNhan.email + "</span>";
                    strCamnhan += "        <span>- Lớp: " + camNhan.lop + "</span>";
                    strCamnhan += "        <span>- Năm sinh: " + camNhan.ngaySinh + "</span>";
                    strCamnhan += "        <span>- Fb: <a rel=\"nofollow\" href=\"" + camNhan.facebook +
                                                    "\" target=\"_blank\">" + camNhan.facebook + "</a></span>";
                    strCamnhan += "    </div>";
                    strCamnhan += "</div>";                   
                }
                strCamnhan += "</div>";  
            }
            return strCamnhan;
        }
    }
}